Skip to content

Conversation

@Gasoonjia
Copy link
Contributor

@Gasoonjia Gasoonjia commented Dec 24, 2025

Stack from ghstack (oldest at bottom):

This diff introduces the foundation for tensor storage management in the SlimTensor migration:

  • util/SharedPtr.h - A lightweight, non-thread-safe shared pointer optimized for single-threaded tensor operations.
  • core/Storage.h - The MaybeOwningStorage class that manages tensor data memory:
    • DeviceTraits specialization with allocate(), free(), memcpy() using malloc/free
    • Owning mode for CPU device (CUDA and non-owning mode added later)
    • Storage type alias as SharedPtr
    • Move semantics for efficient resource transfer
    • clone() and copy_() methods for data management

Differential Revision: D89747980

This diff introduces the foundation for tensor storage management in the SlimTensor migration:

- util/SharedPtr.h - A lightweight, non-thread-safe shared pointer optimized for single-threaded tensor operations.
- core/Storage.h - The MaybeOwningStorage class that manages tensor data memory:
    - DeviceTraits<CPU> specialization with allocate(), free(), memcpy() using malloc/free
    - Owning mode for CPU device (CUDA and non-owning mode added later)
    - Storage type alias as SharedPtr<MaybeOwningStorage>
    - Move semantics for efficient resource transfer
    - clone() and copy_() methods for data management

Differential Revision: [D89747980](https://our.internmc.facebook.com/intern/diff/D89747980/)

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Dec 24, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16383

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure, 1 Cancelled Job, 1 Unrelated Failure

As of commit 39d4ccf with merge base 210047b (image):

NEW FAILURE - The following job has failed:

CANCELLED JOB - The following job was cancelled. Please retry:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants